package com.mgface.dubbo.servicerpc;

import com.alibaba.dubbo.config.annotation.Service;
import com.mgface.dubbo.commonrpc.Ihello;

import java.time.LocalDateTime;

/**
 * @author wanyuxiang
 * @version 1.0
 * @project dubbo
 * @create 2018-08-14 21:57
 **/
@Service(version = "1.0.0",mock = "com.mgface.dubbo.commonrpc.IhelloMock")
public class HelloImpl implements Ihello {
    public String say(String name) {
        System.out.println("你好:"+name);
        double random = Math.random();
        if(random*10>5){
            return "当前时间:"+LocalDateTime.now();
        }else {
            int i = 1/0;
            return "div by zero.error";
        }

    }
}
